<?
	require_once("db.php");
	
	function check_uname($username)
	{
		$flag = 0;
		$table = array("student", "mentor", "guide", "college", "industry");
		foreach($table as $value)
		{
			$query = "select * from $value where username = '".$username."'";
			$result = mysql_query($query);
			if(mysql_num_rows($result) != NULL)
			{
				$flag = 1;
				break;
			}
		}
		if($flag == 1)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	function check_email($email)
	{
		$flag = 0;
		$table = array("student", "mentor", "guide", "college", "industry");
		foreach($table as $value)
		{
			$query = "select * from $value where email = '".$email."'";
			$result = mysql_query($query);
			if(mysql_num_rows($result) != NULL)
			{
				$flag = 1;
				break;
			}
		}
		if($flag == 1)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
?>
